package com.tractorframework.core.effector;

import android.view.View;

import com.tractorframework.core.ViewPort;

public abstract class ViewEffectorBase{

	private View view;
	
	private ViewPort viewport;
	
	public final void onStart(View view) {
		this.view = view;	
		if(viewport == null)
		{
			viewport = new ViewPort();
		}
		viewport.instanceFieldView(this, view);
		onStartOverride(view);
	}

	public final void onStop(View view) {
		this.view = null;
		onStopOverride(view);
	}
	
	protected abstract void onStartOverride(View view);
	
	protected abstract void onStopOverride(View view);
	
	
	protected View getView()
	{
		return this.view;
	}

}
